package cn.wolfcode.crm.service;

import cn.wolfcode.crm.domain.Department;
import cn.wolfcode.crm.query.QueryObject;
import cn.wolfcode.crm.util.PageResult;

import java.util.List;

public interface IDepartmentService {
    int saveOrUpdate(Department record);

    Department selectByPrimaryKey(Long id);

    List<Department> selectAll();

    PageResult query(QueryObject qo);

    /**
     * 根据id改变部门的状态
     * @param id
     */
    void changeState(Long id);

    /**
     * 根据前端传过来的部门编号和数据库做校验
     * @param sn
     * @return
     */
    Boolean validateName(String sn, Long id);

    /**
     * 根据部门名称查询
     * @param deptName
     * @return
     */
    Department selectByDepartmentName(String deptName);
}
